package cn.matezk.cloud.model;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.matezk.cloud.beans.tencent.Automation;
import cn.matezk.cloud.beans.tencent.Device;
import cn.matezk.cloud.beans.tencent.DeviceTimer;
import cn.matezk.cloud.beans.tencent.Manual;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class Transfer {
    private String id;
    private String from;
    private String fromAccessToken;
    private String to;
    private List<Device> device;
    private List<DeviceTimer> timer;
    private List<Automation> automation;
    private List<Manual> manual;
    private Integer status;
    private Date createTime;
    private Date agreeTime;

    public boolean expire() {
        return DateUtil.between(createTime, new Date(), DateUnit.DAY, true) >= 1;
    }
}
